// JavaScript Document
var nofimg = 8;
var imgcount=1;
var prevno=nofimg;
var nextno=imgcount+1;
function mouseovershowimg(imgid,imgpath){
document.getElementById(imgid).src=imgpath;
}
function onclickshowimg(imgid,imgpath){

document.getElementById(imgid).src=imgpath;
}

function slideshownext(cont){
	imgcount=cont;
	imgcount0 = cont-1;
	if (imgcount0>=nofimg)
	    imgcount1=1;
	else
	    imgcount1=imgcount0 + 1;
	    
	
	if(imgcount>=nofimg)
	{
		nextno=1;
		prevno=imgcount-1;
	}
	else
	{
		nextno=imgcount+1;
		prevno=imgcount-1;
	}
	document.getElementById('slideimg1').src=strimgpath+'images/header/ScrollImage-'+imgcount1+'.jpg';
	var strImage = document.getElementById('slideimg1').src;
	var add = strImage.lastIndexOf("/");
	var Image = strImage.substr(add+1);
    var strPath = "";
    var strTitle = "";
	
	if (Image == 'ScrollImage-1.jpg')
	{
	    strPath = strimgpath+"products/santro/New_Hyundai_Santro.asp";
	    strTitle = "Hyundai Santro Xing";
	}
	else if (Image == 'ScrollImage-2.jpg')
	{
	   strPath = strimgpath+"products/i10-new/New_Hyundai_i10.asp";
	   strTitle = "Hyundai i10";
	}
	else if (Image == 'ScrollImage-3.jpg')
	{
	   strPath = strimgpath+"products/i20/New_Hyundai_i20.asp";
	   strTitle = "Hyundai i20";
	}
	else if (Image == 'ScrollImage-4.jpg')
	{
	   strPath = strimgpath+"products/accent/New_Hyundai_Accent.asp";
	   strTitle = "Hyundai Accent Executive";
	}
	else if (Image == 'ScrollImage-5.jpg')
	{
	   strPath = strimgpath+"products/verna-new/New_Hyundai_Fluidic_Verna_RB.asp";
	   strTitle = "Hyundai Fluidic Verna";
	}
	else if (Image == 'ScrollImage-6.jpg')
	{
	   strPath = strimgpath+"products/sonata/New_Hyundai_Sonata.asp";
	   strTitle = "Hyundai Sonata Transform";
	}
	else if (Image == 'ScrollImage-7.jpg')
	{
	   strPath = strimgpath+"products/santafe/New_Hyundai_SantaFe.asp";
	   strTitle = "Hyundai Sante Fe";
	}
	else if (Image == 'ScrollImage-8.jpg')
	{
	   strPath = strimgpath+"products/eon/New_Hyundai_Eon.asp";
	   strTitle = "Hyundai Eon";
	}
	
	
    document.getElementById('linkProduct').href=strPath;
    document.getElementById('linkProduct').title=strTitle;
		
		
}
function slideshowprev(cont){
	imgcount=cont;
	imgcount0 = cont-1;
	if (imgcount0>=nofimg)
	    imgcount1=1;
	else
	    imgcount1=imgcount0 + 1;
	    
	if(imgcount<=1){
	    prevno=nofimg;
	    nextno=imgcount+1;
	}
	else{
		
		prevno=imgcount-1;
		nextno=imgcount+1;
	}
	document.getElementById('slideimg1').src=strimgpath+'images/header/ScrollImage-'+imgcount1+'.jpg';
	var strImage = document.getElementById('slideimg1').src;
	var add = strImage.lastIndexOf("/");
	var Image = strImage.substr(add+1);
	var strPath = "";
	
	if (Image == 'ScrollImage-1.jpg')
	{
	    strPath = strimgpath+"products/santro/New_Hyundai_Santro.asp";
	    strTitle = "Hyundai Santro Xing";
	}
	else if (Image == 'ScrollImage-2.jpg')
	{
	   strPath = strimgpath+"products/i10-new/New_Hyundai_i10.asp";
	   strTitle = "Hyundai i10";
	}
	else if (Image == 'ScrollImage-3.jpg')
	{
	   strPath = strimgpath+"products/i20/New_Hyundai_i20.asp";
	   strTitle = "Hyundai i20";
	}
	else if (Image == 'ScrollImage-4.jpg')
	{
	   strPath = strimgpath+"products/accent/New_Hyundai_Accent.asp";
	   strTitle = "Hyundai Accent Executive";
	}
	else if (Image == 'ScrollImage-5.jpg')
	{
	   strPath = strimgpath+"products/verna-new/New_Hyundai_Fluidic_Verna_RB.asp";
	   strTitle = "Hyundai Fluidic Verna";
	}
	else if (Image == 'ScrollImage-6.jpg')
	{
	   strPath = strimgpath+"products/sonata/New_Hyundai_Sonata.asp";
	   strTitle = "Hyundai Sonata Transform";
	}
	else if (Image == 'ScrollImage-7.jpg')
	{
	   strPath = strimgpath+"products/santafe/New_Hyundai_SantaFe.asp";
	   strTitle = "Hyundai Santa Fe";
	}
		else if (Image == 'ScrollImage-8.jpg')
	{
	   strPath = strimgpath+"products/Eon/Eon.asp";
	   strTitle = "Eon";
	}
	
    document.getElementById('linkProduct').href=strPath;
    document.getElementById('linkProduct').title=strTitle;

}

