<!--
function swapPic()

 {
 if(document.getElementById)
   {
   var thePicture=document.getElementById("promo-jpg");
   var picPath="images/home-rotate-0"+rnd(5)+".jpg";
   thePicture.style.background="url("+picPath+")";
   }
 }

function rnd(n)
 {
 return Math.floor(Math.random() * n) + 1;
 }

function customWindow(url, width, height) {
	window.open(url,'couponWin','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width='+width+', height='+height);
	return false;
}

function go2Service (form) {
	if (form.service_link.selectedIndex == 1) {location.href = "service-details.php#women-dress"}
	if (form.service_link.selectedIndex == 2) {location.href = "service-details.php#mens-suits"}
	if (form.service_link.selectedIndex == 3) {location.href = "service-details.php#leather-garments"}
	if (form.service_link.selectedIndex == 4) {location.href = "service-details.php#wedding-dress"}
	if (form.service_link.selectedIndex == 5) {location.href = "service-details.php#jeans"}
	if (form.service_link.selectedIndex == 6) {location.href = "service-details.php#sweaters"}
}

function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") &&
anchor.getAttribute("rel") == "external")
anchor.target = "_blank";
}
}
window.onload = externalLinks;

/*Email page*/
function mailpage()

	{
	mail_str = "mailto:?subject=Use This Hot Coupon for Shin-Sen-Gumi";
	mail_str += "&body=I found some Coupon on shinsengumiusa.com that I thought was worth sharing.";
	mail_str += " Check it out here:  " + location.href + "."; 
	location.href = mail_str;
	//Syntax for the link: <a href="javascript:mailpage()">Email This Page</a>
	}
	
/*Print Page*/
var gAutoPrint = true; // Flag for whether or not to automatically call the print function

function printSpecial()

{
	if (document.getElementById != null)
	{
		var html = '<HTML>\n<HEAD>\n';
		if (document.getElementsByTagName != null)
		{
			var headTags = document.getElementsByTagName("head");
			if (headTags.length > 0)
				html += headTags[0].innerHTML;
		}
		html += '\n</HE' + 'AD>\n<BODY>\n';

		var printReadyElem = document.getElementById("printReady");
		if (printReadyElem != null)
		{
				html += printReadyElem.innerHTML;
		}
		else
		{
			alert("Could not find the printReady section in the HTML");
			return;
		}
		html += '</td></tr></table>\n'
		html += '\n</BO' + 'DY>\n</HT' + 'ML>';
		var printWin = window.open("","printSpecial");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if (gAutoPrint)
			printWin.print();
	}
	else
	{
		alert("Sorry, the print ready feature is only available in modern browsers.");
	}
}

/* OTHER FUNCTIONS*/
function limitText(limitField, limitCount, limitNum) {
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} else {
		limitCount.value = limitNum - limitField.value.length;
	}
}
 //-->