// JavaScript Document
window.onerror=function(){ return true;}

// function call to set no of views for article

function set_article_views(article_id)
{
	showContent('adm-articles.php',article_id,1,'','');
}

function set_article_noOfviews(articleId)
{
	showContent('../../../../adm-articles-topic.php',articleId,2,'','');
}


function set_help_product_rating(productId, YesNo)
{
  showContent('../../../../../adm-products.php?YesNo=' + YesNo, productId, 1, '', '');
}


function set_help_nonhelpful_reviews(productId, reviewId, YesNo)
{
  showContent('../../../../../adm-reviews.php?reviewId=' + reviewId + '&YesNo=' + YesNo, productId, 6, '', '');
}


function set_review_help_nothelp(productId, YesNo)
{
  showContent('../../../../../adm-reviews.php?YesNo=' + YesNo, productId, 5, '', '');
}

function set_video_views(video_id)
{
	showContent('adm-videos.php', video_id, 2, '', '');
}


// This function is to set help ful review on click on the yes at all user reviews page.
function set_help_nonhelpful_reviews_all(productId, reviewId, YesNo)
{
  showContent('adm-reviews.php?reviewId=' + reviewId + '&YesNo=' + YesNo, productId, 6, '', '');
}




// Funtion to show post comment table

function showCommentForm()
{
	idLink = document.getElementById('post_link');
	idForm = document.getElementById('comment_form');
	
	if(idForm.style.display=='none')
	{
	 	idForm.style.display='';
	}
	else
	{	
	 	idForm.style.display='none';
	}
	
}



// function call to show div's on mouseover in most popular section

function showArrow(LINKS)
{
  imgId1 = document.getElementById('img1');
  imgId2 = document.getElementById('img2');
  imgId3 = document.getElementById('img3');
  LINK1  = document.getElementById('link1');
  LINK2  = document.getElementById('link2');
  LINK3  = document.getElementById('link3');
  divId1 = document.getElementById('MPCH');
  divId2 = document.getElementById('MPAT');
  divId3 = document.getElementById('MPYF');
  
  if(LINKS=='link1')
  {
	imgId1.style.display='';
	imgId2.style.display='none';
	imgId3.style.display='none';
	LINK1.style.color='yellow';
        LINK2.style.color='white';
        LINK3.style.color='white';
	divId1.style.display='';
	divId2.style.display='none';	
	divId3.style.display='none';		
  }
  if(LINKS=='link2')
  {
	imgId1.style.display='none';
	imgId2.style.display='';
	imgId3.style.display='none';
	LINK1.style.color='white';
        LINK2.style.color='yellow';
        LINK3.style.color='white';
	divId1.style.display='none';
	divId2.style.display='';	
	divId3.style.display='none';	
  }
  if(LINKS=='link3')
  {
	imgId1.style.display='none';
	imgId2.style.display='none';
	imgId3.style.display='';
	LINK1.style.color='white';
        LINK2.style.color='white';
        LINK3.style.color='yellow';
	divId1.style.display='none';
	divId2.style.display='none';	
	divId3.style.display='';	
  }
  
}


// refresh image on click of that image
function refreshCaptcha()
{
	var img = document.images['captchaimg'];
	img.src = img.src.substring(0,img.src.lastIndexOf("?"))+"?rand="+Math.random()*1000;
}


// function for footer in all pages
function footer(GetUrl)
{
	// To make the current year dynamic	
        var currentDate = new Date()
        var currentYear = currentDate.getFullYear();
	
	var str='';
	
          str+="<div id='footerInnerDiv'>";
          str+="<div class='fut_blank'>&nbsp;</div>";
          str+="<div class='fut_home' id='fut_stl'><a href='" + GetUrl + "index.php' title='Home'>Home</a></div>";
          str+="<div class='fut_pipe'>|</div>";
          str+="<div class='fut_contact' id='fut_stl'><a href='" + GetUrl + "contact-us' title='Contact Us'>Contact Us</a></div>";
          str+="<div class='fut_pipe'>|</div>";
          str+="<div class='fut_privacy' id='fut_stl'><a href='" + GetUrl + "privacy' title='Privacy'>Privacy</a></div>";
          str+="<div class='fut_pipe'>|</div>";
          str+="<div class='fut_tou' id='fut_stl'><a href='" + GetUrl + "terms-of-use' title='Terms of Use'>Terms of Use</a></div>";
          str+="<div class='fut_pipe'>|</div>";
          str+="<div class='fut_partners' id='fut_stl'><a href='" + GetUrl + "partners' title='Partners'>Partners</a></div>";
          str+="<div class='fut_pipe'>|</div>";
          str+="<div class='fut_wantCont' id='fut_stl'><a href='" + GetUrl + "want-to-contribute' title='Want To Contribute?'>Want To Contribute?</a></div>";
          str+="</div>";
          str+="<div class='copyRightmainDiv'><div class='medmaLogoDiv' align='left'><span class='fntPoweredBy'>&nbsp;Designed &amp; developed by&nbsp;:</span>&nbsp;<a href='http://www.medma.net' target='_blank' title='Medma Infomatix Pvt. Ltd.'><img src='" + GetUrl + "/images/medma-logo.jpg' alt='Medma Infomatix Pvt. Ltd.' /></a></div><div class='copyRightFntDiv coptRightFnt'>Copyright &copy; 2006 - " + currentYear +"&nbsp;&nbsp;Yvonne Rice&nbsp;</div><div class='xhtmlLogoDiv' align='right'><img src='http://www.w3.org/Icons/valid-xhtml10' alt='Valid XHTML 1.0 Transitional' height='25' width='80' style='position:relative; top:-3px;' /></div></div>";
          document.write(str);
}

// Go to that back page wheres you coming from
function goToBackPage()
{
	window.location.href='javascript:history.back();';
}

// Go to that specified url
function goToPageURL(pageUrl)
{
	window.location.href = pageUrl;
}


/*------Below code to show tool tip on the mouse over of the Forum Title-------*/


/***********************************************
* Cool DHTML tooltip script II- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip

var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer" src="images/arrow.png">') //write out pointer image

var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thewidth, thecolor){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip

