/*  after test, mearge this to common.js */

function writeChafileForm(bookMarkType) 
{
	document.writeln('<form name="chafile_bookmark" action="http://www.chafile.com/chafile/member/post.html" method="post" target="_chafile">');
	document.writeln('<input type="hidden" name="siteId" value="1001343" />');
	document.writeln('<input type="hidden" name="performerId" value="" />');
	document.writeln('<input type="hidden" name="performerName" value="" />');
	document.writeln('<input type="hidden" name="url" value="" />');
	document.writeln('<input type="hidden" name="type" value="'+bookMarkType+'" />');
	document.writeln('<input type="hidden" name="title" value="" />');
	document.writeln('</form>');
}

function submitChafileForm(performerId,performerName,imageName)
{
	var bookmarkURL = '';
	var bookmarkType = document.chafile_bookmark.type.value;

	 if (bookmarkType == '1') //photo  not used for v3
	 	bookmarkURL = 'http://imageup.exshot.com/WebArchive/'+performerName+'/original/'+imageName+'.jpg';

	 else if (bookmarkType == '2') //movie
	 	bookmarkURL = 'http://www.exshot.com/app/video/video.php?uname='+performerName;

	 else if (bookmarkType == '3') //gallery
	 	bookmarkURL = 'http://www.exshot.com/gallery/'+performerName+'.html';

	 else if (bookmarkType == '4') //profile
	 	bookmarkURL = 'http://www.exshot.com/profile/'+performerName+'.html';

	 else if (bookmarkType == '5') //blog not used for exshot only dxlive
	 	bookmarkURL = '';

	 else if (bookmarkType == '6') //fanclub not used for exshot only dxlive
	 	bookmarkURL = '';

	 else if (bookmarkType == '7') //diary
	 	bookmarkURL = 'http://www.exshot.com/diary/'+performerName+'.html';

	 else if (bookmarkType == '8') //detailedProfile
	 	bookmarkURL = 'http://www.exshot.com/detail/'+performerName+'.html';

	 else if (bookmarkType == '9') //preview
	 	bookmarkURL = 'http://www.exshot.com/app/preview.php?uid='+performerId;

	 else
	 	document.chafile_bookmark.type.value = 0;

	if (bookmarkType == '1') //photo
			document.chafile_bookmark.title.value = imageName+'.jpg';
			
	document.chafile_bookmark.performerId.value = performerId;
	document.chafile_bookmark.performerName.value = performerName;
	document.chafile_bookmark.url.value = bookmarkURL;
	document.chafile_bookmark.submit();
}