var application_path="http://www.res-con.biz/";
var borderColor = ""; /* border color hex or left it null if you don't want to change border color*/
var captchaDir = "" /* path to captcha files (if you use domain www.example.com path should present all subfolders after that, start with "/") */
var url = captchaDir + "sign_up_response.php" /* this is name of form action */
var formId = "createaccount" /* id of your form */
var items = Array("pencil", "scissors", "clock", "heart", "note"); 

//===variable declarations to hold the number of page counts======
var itemsPerPageNews=20;
var itemsPerPageReports=10;
var itemsPerPageAnalysis=2;
var itemsPerPageWrapup=5;
var itemsPerPageAnnouncement=5;
var itemsPerPageKnow=20;
//==================================================================

//======declarations to count the id of the passed values===========
var news_id=0;
var analysis_id=0;
var report_id=0;
var wrapup_id=0;
var announcement_id=0;
var know_id=0;
//==================================================================


var IsAjaxWhite=false;

loadPage=function(eleFrame,urlPage)
{
	var frmObject=$(eleFrame);
	if (frmObject!=null)
	{
		frmObject.src=urlPage;
	}
};
		
/**
* Callback functions that displays the content.
* Gets called every time the user clicks on a pagination link.
* @param {int}page_index New Page index
* @param {jQuery} jq the container with the pagination links as a jQuery object
*/
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<---PaginationForReport--->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
function pageselectCallback(page_index, jq){

	if(paginationFirstCall){
		paginationFirstCall=false;
		return;
	}
	new_content="";
	new_content='<a name="report"></a><table width="232" border="0" cellspacing="0" cellpadding="0" align="left" class="mar5px"><tr><td><img src="images/ttl-Repertoire.gif"/></td></tr>';
	new_content=new_content+'<tr><td height="399" valign="top"><ul class="normal_list">';
	tempStr="";
	$.ajax({
			type:"POST",
			mode:"sync",
			url:application_path+"report_column.php?n="+itemsPerPageReport+"&report_id="+report_id,
			data:"i="+page_index,
			success:function(data){
				var dataArrayNews=data.split("#");
				var cnt=0;
				if (dataArrayNews.length>1)
				{
					$.each(dataArrayNews,function(intIndexData,objValueData)
	                {			
						var dataArray=objValueData.split("*");
						  $.each(dataArray,function(intIndex,objValue){
								if (cnt==0) {tempStr=tempStr+objValue;cnt++;}
								else
								{
									if (objValue!="")
									{
										tempStr=tempStr+"<li>"+objValue+"</li>";
									}
								}
						});
					});
				}
				else
				{
					var dataArray=data.split("*");
					$.each(dataArray,function(intIndex,objValue){
						tempStr=tempStr+"<li>"+objValue+"</li>";
					});
					
				}
				    
					new_content=new_content+tempStr+'</ul></td></tr></table>';
					
					$("#report_column_left").empty().append(new_content);				
			}
		});
		return false;
	}
	
	function initPagination(firstLoad,totalCount,itemsPerPage,_height,_width,isWhite,id) {
		paginationFirstCall=firstLoad;
		ajaxReturnHeight=_height;
		ajaxReturnWidth=_width;
		IsAjaxWhite=isWhite;
		itemsPerPageReport=itemsPerPage;
		report_id=id;
	   $("#Pagination").pagination(totalCount, {
			num_edge_entries: 4,
			num_display_entries: 6,
			callback: pageselectCallback,
			items_per_page:itemsPerPage,
			prev_text:"<<",
			next_text:">>"

		});
	 }
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<---PaginationForNews>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
function pageselectCallbackNews(page_index,jq){

	if(paginationFirstCall){
		paginationFirstCall=false;
		return;
	}
	
	new_content="";
	if(!IsAjaxWhite)
	{
		new_content='<a name="news"></a><table width="232" border="0" cellspacing="0" cellpadding="0" align="left" class="mar5px"><tr><td><img src="images/ttl-MNews-left.gif"/></td></tr><tr><td height="400" valign="top"><ul class="normal_list">';
	}
	else
	{
		new_content='<table width="450" border="0" cellspacing="0" cellpadding="0" align="left" class="mar5px"><tr><td><a name="news"></a><img src="images/ttl-MNews.gif" width="232" height="30" /></td></tr><tr><td  height="696"><ul class="normal_list_white">';
	}
	tempStr="";
	$.ajax({
			type:"POST",
			mode:"sync",
			url:application_path+"news_column.php?n="+itemsPerPageNews+"&news_id="+news_id,
			data:"i="+page_index,
			success:function(data){
				var dataArrayNews=data.split("#");
				var cnt=0;
				if (dataArrayNews.length>1)
				{
					$.each(dataArrayNews,function(intIndexData,objValueData)
	                {			
						var dataArray=objValueData.split("*");
						cnt=0;
						  $.each(dataArray,function(intIndex,objValue){
								if (cnt==0) {tempStr=tempStr+objValue;cnt++;}
								else
								{
									if (objValue!="")
									{
										tempStr=tempStr+"<li>"+objValue+"</li>";
										
									}
								}
						});
					});
				}
				else
				{
					var dataArray=data.split("*");
					
					$.each(dataArray,function(intIndex,objValue){
											  
						if(objValue.indexOf("div")>0){tempStr=tempStr+objValue;}
						
						else{
							
								tempStr=tempStr+"<li>"+objValue+"</li>";
								
							}
					});
					
				}

					new_content=new_content+tempStr+'</ul></td></tr></table>';
					$("#news_column").empty().append(new_content);				
			}
		});
		return false;
	}
	
	function initPaginationNews(firstLoad,totalCount,itemsPerPage,_height,_width,isWhite,id) {
		paginationFirstCall=firstLoad;
		ajaxReturnHeight=_height;
		ajaxReturnWidth=_width;
		IsAjaxWhite=isWhite;
		itemsPerPageNews=itemsPerPage;
		news_id=id;
		
	   $("#paginationNews").pagination(totalCount, {
			num_edge_entries: 2,
			num_display_entries: 4,
			callback: pageselectCallbackNews,
			items_per_page:itemsPerPage,
			prev_text:"<<",
			next_text:">>"
		});
	 }
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<---PaginationForAnalysis>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
function pageselectCallbackAnalysis(page_index, jq){

	if(paginationFirstCall){
		paginationFirstCall=false;
		return;
	}
	
	new_content="";

	new_content='<a name="analysis"></a><table width="232" border="0" cellspacing="0" cellpadding="0" align="left" class="mar5px"><tr><td><img src="images/ttl-RCAnalysis.gif"/></td></tr><tr><td height="150" valign="top"><ul class="normal_list">';
	tempStr="";
	$.ajax({
			type:"POST",
			mode:"sync",
			url:application_path+"analysis_column.php?n="+itemsPerPageAnalysis+"&analysis_id="+analysis_id,
			data:"i="+page_index,
			success:function(data){
				var dataArrayNews=data.split("#");
				var cnt=0;
				if (dataArrayNews.length>1)
				{
					$.each(dataArrayNews,function(intIndexData,objValueData)
	                {			
						var dataArray=objValueData.split("*");
						  $.each(dataArray,function(intIndex,objValue){
								if (cnt==0) {tempStr=tempStr+objValue;cnt++;}
								else
								{
									if (objValue!="")
									{
										tempStr=tempStr+"<li>"+objValue+"</li>";
									}
								}
						});
					});
				}
				else
				{
					var dataArray=data.split("*");
					
					$.each(dataArray,function(intIndex,objValue){
						tempStr=tempStr+"<li>"+objValue+"</li>";
					});
					
				}

					new_content=new_content+tempStr+'</ul></td></tr></table>';
					$("#analysis_column").empty().append(new_content);				
			}
		});
		return false;
	}
	
	function initPaginationAnalysis(firstLoad,totalCount,itemsPerPage,_height,_width,isWhite,id) {
		//===load the parameter to be called by the call back function====
		paginationFirstCall=firstLoad;
		ajaxReturnHeight=_height;
		ajaxReturnWidth=_width;
		IsAjaxWhite=isWhite;
		itemsPerPageAnalysis=itemsPerPage;
		analysis_id=id;

	   $("#paginationAnalysis").pagination(totalCount, {
			num_edge_entries: 4,
			num_display_entries: 6,
			callback: pageselectCallbackAnalysis,
			items_per_page:itemsPerPage,
			prev_text:"<<",
			next_text:">>"
		});
	 }

//<<<<<<<<<<<<<<<<<<<<<<<<<<<<---PaginationForWrapUp>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
function pageselectCallbackWrap(page_index, jq){

	if(paginationFirstCall){
		paginationFirstCall=false;
		return;
	}
	
	new_content="";

	new_content='<a href="#" name="wrap"></a><table width="232" border="0" cellspacing="0" cellpadding="0" align="left" class="mar5px"><tr><td><img src="images/ttl-WeeklyWrapUp.gif" /></td></tr><tr><td height="205" valign="top"><ul class="normal_list">';
	
	tempStr="";

	$.ajax({
			type:"POST",
			mode:"sync",
			url:application_path+"wrapup_column.php?n="+itemsPerPageWrapup+"&wrapup_id="+wrapup_id,
			data:"i="+page_index,
			success:function(data){
				var dataArrayNews=data.split("#");
				var cnt=0;
				if (dataArrayNews.length>1)
				{
					$.each(dataArrayNews,function(intIndexData,objValueData)
	                {			
						var dataArray=objValueData.split("*");
						  $.each(dataArray,function(intIndex,objValue){
								if (cnt==0) {tempStr=tempStr+objValue;cnt++;}
								else
								{
									if (objValue!="")
									{
										tempStr=tempStr+"<li>"+objValue+"</li>";
									}
								}
						});
					});
				}
				else
				{
					var dataArray=data.split("*");
					
					$.each(dataArray,function(intIndex,objValue){
						tempStr=tempStr+"<li>"+objValue+"</li>";
					});
					
				}

					new_content=new_content+tempStr+'</ul></td></tr></table>';
					$("#wrapup_column").empty().append(new_content);				
			}
		});
		return false;
	}
	
	function initPaginationWrap(firstLoad,totalCount,itemsPerPage,_height,_width,isWhite,id) {
		paginationFirstCall=firstLoad;
		ajaxReturnHeight=_height;
		ajaxReturnWidth=_width;
		IsAjaxWhite=isWhite;
		itemsPerPageWrapup=itemsPerPage;
		wrapup_id=id;
	   $("#paginationWrap").pagination(totalCount, {
			num_edge_entries: 4,
			num_display_entries: 6,
			callback: pageselectCallbackWrap,
			items_per_page:itemsPerPage,
			prev_text:"<<",
			next_text:">>"
		});
	 }
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<---PaginationForAnnounce>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
function pageselectCallbackAnnounce(page_index, jq){

	if(paginationFirstCall){
		paginationFirstCall=false;
		return;
	}
	
	new_content="";

	new_content='<table width="232" border="0" cellspacing="0" cellpadding="0" align="left" class="mar5px"><tr><td><img src="images/ttl-Announcements-Left.gif" /></td> </tr><tr><td height="180" valign="top"><ul class="normal_list" id="nomargin">';
	
	tempStr="";

	$.ajax({
			type:"POST",
			mode:"sync",
			url:application_path+"company_announcements_column_left.php?n="+itemsPerPageAnnouncement+"&comp_announcements_date="+announcement_id,
			data:"i="+page_index,
			success:function(data){
				
				var dataArrayNews=data.split("#");
				var cnt=0;
				if (dataArrayNews.length>1)
				{
					$.each(dataArrayNews,function(intIndexData,objValueData)
	                {			
						var dataArray=objValueData.split("$");
						  $.each(dataArray,function(intIndex,objValue){
								if (cnt==0) {tempStr=tempStr+objValue;cnt++;}
								else
								{
									if (objValue!="")
									{
										tempStr=tempStr+"<li>"+objValue+"</li>";
									}
								}
						});
					});
				}
				else
				{
					var dataArray=data.split("$");
					
					$.each(dataArray,function(intIndex,objValue){
						tempStr=tempStr+"<li>"+objValue+"</li>";
					});
					
				}

					new_content=new_content+tempStr+'</ul></td></tr></table>';
					$("#company_announcements_column_left").empty().append(new_content);				
			}
		});
		return false;
	}
	
	function initPaginationAnnouncement(firstLoad,totalCount,itemsPerPage,_height,_width,isWhite,id) {
		paginationFirstCall=firstLoad;
		ajaxReturnHeight=_height;
		ajaxReturnWidth=_width;
		IsAjaxWhite=isWhite;
		itemsPerPageAnnouncement=itemsPerPage;
		announcement_id=id;//this is the announcement date
	   $("#paginationAnnouncements").pagination(totalCount, {
			num_edge_entries: 4,
			num_display_entries: 6,
			callback: pageselectCallbackAnnounce,
			items_per_page:itemsPerPage,
			prev_text:"<<",
			next_text:">>"
		});
	 }

//<<<<<<<<<<<<<<<<<<<<<<<<<<<<---PaginationForKnow>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
function pageselectCallbackKnow(page_index, jq){

	if(paginationFirstCall){
		paginationFirstCall=false;
		return;
	}
	
	new_content="";
   if(!IsAjaxWhite)
   {
	   new_content='<table width="232" border="0" cellspacing="0" cellpadding="0" align="left" class="mar5px"><tr><td><img src="images/ttl-Know-left.gif" /></td></tr> <tr><td height="205"><ul class="normal_list">';
   }
   else
   {
		new_content='<a href="#" name="know"></a><table width="232" border="0" cellspacing="0" cellpadding="0" align="left" class="mar5px"><tr><td><a name="know"></a><img src="images/ttl-Know.gif" /></td></tr><tr><td height="696" valign="top"><ul class="normal_list_white">';
   }
	tempStr="";
     
	$.ajax({
			type:"POST",
			mode:"sync",
			url:application_path+"know_column.php?n="+itemsPerPageKnow+"&know_id="+know_id,
			data:"i="+page_index,
			success:function(data){
				var dataArrayNews=data.split("#");
				var cnt=0;
				if (dataArrayNews.length>1)
				{
					$.each(dataArrayNews,function(intIndexData,objValueData)
	                {			
						var dataArray=objValueData.split("*");
						  $.each(dataArray,function(intIndex,objValue){
								if (cnt==0) {tempStr=tempStr+objValue;cnt++;}
								else
								{
									if (objValue!="")
									{
										tempStr=tempStr+"<li>"+objValue+"</li>";
									}
								}
						});
					});
				}
				else
				{
					var dataArray=data.split("*");
					$.each(dataArray,function(intIndex,objValue){
					tempStr=tempStr+"<li>"+objValue+"</li>";
					});
					
				}
					new_content=new_content+tempStr+'</ul></td></tr></table>';
					$("#know_column").empty().append(new_content);				
			}
		});
		return false;
	}
	
	function initPaginationKnow(firstLoad,totalCount,itemsPerPage,_height,_width,isWhite,id) {
		paginationFirstCall=firstLoad;
		ajaxReturnHeight=_height;
		ajaxReturnWidth=_width;
		IsAjaxWhite=isWhite;
		itemsPerPageKnow=itemsPerPage;
		know_id=id;
	   $("#paginationKnow").pagination(totalCount, {
			num_edge_entries: 4,
			num_display_entries: 6,
			callback: pageselectCallbackKnow,
			items_per_page:itemsPerPage,
			prev_text:"<<",
			next_text:">>"
		});
	 }
	 
<!-- function for fade in fade out news announcement---->
<!-- uses jquery cycle for the animation--------------->
<!--parameters div id, div css class,array content of the div to display which is dynamically appended-->
<!--data array comes as text1$link,text2$link,text3$link------------------------------------------------>
function letsSlideIt(idID,cssID,contentInside)
{
	
	var tempString='';
	var newsArray=contentInside.split("|");
	$.each(newsArray,function(intIndex,objValue)
	{
		if(objValue!=null)
		{
			var tempArray=objValue.split('$');
			if(tempArray[0]!='' && tempArray[1]!='')
				tempString+='<div class="newsgrpDiv"><a style="text-decoration:none" href="'+ tempArray[2]+'"><div class="newsTitle">'+tempArray[0]+'</div><span>'+tempArray[1]+'</span></a></div>';
		}
	});
	$('#'+idID).empty().append(tempString);
	var all = $('.scroll').scrollable({size: 1}).circular().autoscroll(8000);
}
